Create a List of all Installed Packages The following command will store the list of all installed packages on your Debian system to a file called packages_list.txt: sudo dpkg-query -f '${binary:Package}\n' -W > packages_list.txt apt-get install $(grep -vE "^\s*#" packages_list.txt | tr "\n" " ")